package vn.csp.gameportal;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class ViewPagerAdapter extends FragmentPagerAdapter {

	// Declare the number of ViewPager pages
	final int PAGE_COUNT = 4;

	public ViewPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int arg0) {
		switch (arg0) {

			// Open FragmentTab1.java
		case 0:
			FragmentCategory fragmenttab1 = new FragmentCategory();
			return fragmenttab1;

			// Open FragmentTab2.java
		case 1:
			FragmentDown fragmenttab2 = new FragmentDown();
			return fragmenttab2;

			// Open FragmentTab3.java
		case 2:
			FragmentNewest fragmenttab3 = new FragmentNewest();
			return fragmenttab3;
		case 3:
			FragmentBest fragmenttab4 = new FragmentBest();
			return fragmenttab4;
		}
		return null;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return PAGE_COUNT;
	}

}
